package org.sky.lintCode.start;

import java.math.BigDecimal;

/**
 * 两个任意类型数相加返回Double
 *
 * @author fog
 * @date 2021/11/14
 */

public class TwoNumber {

    public static void main(String[] args) {
        Double aDouble = numberSummation(1.1,2.2);

        System.out.println(aDouble);
    }

    public static Double numberSummation(Number number01, Number number02) {
        BigDecimal n1 = BigDecimal.valueOf(number01.doubleValue());
        BigDecimal n2 = BigDecimal.valueOf(number02.doubleValue());
        return n1.add(n2).doubleValue();
    }

}
